package phoneBook;

import arcademis.server.*;

public class Server {

	public static void main(String args[]) {
		if(args.length != 2) {
			System.err.println("Sintaxe: java PhoneBook objName fileName");
			System.exit(1);
		}
		else {
			try {
				rme.RmeConfigurator c = new rme.RmeConfigurator();
				c.configure();

				PhoneBook o = new PhoneBook();
				rme.naming.RmeNaming.bind(args[0], o);
				o.activate();
				o.readFile(args[1]);
			} catch (arcademis.ArcademisException e) {
				e.printStackTrace();
			} catch (arcademis.concreteComponents.MalformedURLException e) {
				e.printStackTrace();
			} catch (AlreadyBoundException e) {
				e.printStackTrace();
			} catch (java.io.IOException e) {
				e.printStackTrace();
			}
		}
	}
}